package com.tencent.wxcloudrun.common;


import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.io.Serializable;

@JsonIgnoreProperties(
        ignoreUnknown = true
)
public class Result<T> implements Serializable {
    private static final long serialVersionUID = 6755608861621214878L;
    private int ec;
    private String em;
    private long timestamp;
    private T data;

    public Result() {
        this.data = null;
        this.timestamp = System.currentTimeMillis();
    }

    public Result(int ec, String em) {
        this.data = null;
        this.ec = ec;
        this.em = em;
        this.timestamp = System.currentTimeMillis();
    }

    public Result(int ec, String em, T data) {
        this(ec, em);
        this.data = data;
    }

    public int getEc() {
        return this.ec;
    }

    public void setEc(int ec) {
        this.ec = ec;
    }

    public String getEm() {
        return this.em;
    }

    public void setEm(String em) {
        this.em = em;
    }

    public long getTimestamp() {
        return this.timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public T getData() {
        return this.data;
    }

    public void setData(T data) {
        this.data = data;
    }
}